package es.ats.codington.festival.mappers;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import es.ats.codington.festival.domain.Event;
import es.ats.codington.festival.domain.Visitor;

public class EventMapper implements RowMapper<Event> {

	@Override
	public Event mapRow(ResultSet resultSet, int numRow) throws SQLException {
		Event event = new Event();
			event.setId(resultSet.getInt("idEvent"));
			event.setName(resultSet.getString("Name"));
			event.setDescription(resultSet.getString("Description"));
			event.setDuration(resultSet.getInt("Duration"));
			event.setTypeEvent(resultSet.getString("EventType"));
			event.setCapacity(resultSet.getInt("Capacity"));
			event.setIdPlace(resultSet.getInt("PlaceId"));
		return event;
	}
}